<html>
<header>
    <script src="http://127.0.0.1:8080/fronter.js"></script>
    <script src="https://cdn.rawgit.com/dcodeIO/protobuf.js/6.11.0/dist/protobuf.js"></script>

</header>

<body>
    <script>
        var ws = new WebSocket("ws://localhost:8112/proto");
        //连接打开时触发 
        ws.onopen = function (evt) {
            console.log("Connection open ...");
        };
        //接收到消息时触发  
        ws.onmessage = function (evt) {
            console.log("Received Message: " + evt.data);
        };
        //连接关闭时触发  
        ws.onclose = function (evt) {
            console.log("Connection closed.");
        };
        
    </script>
</body>

</html>